<template>
  <div>
    <div @click="add">{{test.name}}{{test.content}}</div>
    <div >{{test.user}}</div>
    <el-button type="danger" @click="reset" icon="Delete" circle />
    <hr>
    <div>{{result}}</div>
    <div>{{name}}</div>
    <!-- <A></A> -->
  </div>
</template>
<script setup lang="ts">
import A from './aa.vue'
import {userTest} from '../../../store/modules/test'
import { storeToRefs } from 'pinia'
import { reactive, ref, toRef ,toRefs} from 'vue'
const test = userTest()
// const {name,content } = storeToRefs(test)
// type Result = {
//       name:string,
//     age:number
// }
const result =reactive( {
    name:'2',
    age:18
})
type List = (string|number)[]
const list : List= ['ll',2]
const {name} = toRefs(result)
const reset = ()=>{
  console.log(name);
  
   name.value = 'lll'
}
const add  =(num: number,num1: number)=>{
  return 5
}
add(5,5)
interface ob1 {
  name:string,
  age?:number,
  spank(name:string):void
} 
// interface ob2 {
//   // name:string,
//   result:number,
//   // spank(name:string):void
// } 
interface  ob2 extends ob1 {
  result:number
}
let ob:ob2 = {
  name:'雷',
  age:18,
  result:18,
  spank(name){
      return 6
  },
}
let numberList :[number] = [1]
let age:18 = 18
enum Obj {
  Left,top
}
const foo =(name:Obj)=>{

} 
function fii(name:Obj){
  console.log(name,'000');
}
foo(1)
fii(Obj.Left)

function a (obj:typeof b){

}
let b = {name:'leu',age:18}
a({name:'o',age:17})
// import SvgIcon from '@/components/SvgIcon/src/SvgIcon.vue'
// const add=()=>{
//  const arr:any = [23, 443,54, [34,2, 34, 3241]]
//    const arr1 = arr.flat (2)
//   console.log(arr1);
//   // test.content++
//   // test.$patch({
//   //   name:"LEI",
//   //   content:88888
//   // })
//   // test.$patch((state)=>{
//   //       state.name = "jing"
//   //   state.content = 88888
//   // })
//   test.emitUser(456,'kk')
//   name.value = '4567'
// }
// const reset = () =>{
//   test.$reset()
// }
// test.$subscribe((arg,state)=>{
//   console.log(arg,state);
  
// })
</script>
